package com.qixin.total.controller;


import com.alibaba.fastjson.JSONObject;
import com.qixin.api.bean.*;
import com.qixin.api.service.ComUserCarRentingService;
import com.qixin.api.service.TuizuService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.SQLException;

/**
 * <p>
 * 退租表 前端控制器
 * </p>
 *
 * @author 李许多
 * @since 2018-11-28
 */
@Controller
@RequestMapping("/Tuizu")
public class TuizuController {
    private static final Logger logger = LoggerFactory.getLogger(TuizuController.class);
    @Autowired
    TuizuService tuizuService;
    @Autowired
    ComUserCarRentingService comUserCarRentingService;

    /**
     * 跳转页面
     *
     * @return
     */
    @RequestMapping("/main.html")
    public String Tuizu() {
        return "/pingtai/Tuizu";

    }

    /**
     * 查询
     *
     * @param voPage
     * @return
     */
    @RequestMapping("/select")
    @ResponseBody
    public ResultPage<Tuizu> list(VoPage voPage) {
        ResultPage<Tuizu> resultPage = tuizuService.selectALL(voPage);
        return resultPage;
    }

    /**
     * 修改
     *
     * @param
     * @return
     */
    @RequestMapping("/check")
    @ResponseBody
    public boolean updatecheck(Long id, Long carId,Long userId) {

            return  comUserCarRentingService.comit(carId,id,userId);

    }

}
